$(function() {
	admin.pubUpgrade.init();
});
Namespace('admin.pubUpgrade', {
	init : function() {
		easyui.util.initDatagrid('#datagrid', {
			onDblClickRow : function() {
			}
		});
	},
	query : function() {
		if (!$('#query-form').form('validate'))
			return;
		var data = $('#query-form').form('jsonObject');
		$('#datagrid').datagrid('load', data);
	},
	confirm: function (overrideMsgId) {
		var tip = "确定推送升级吗";
		$.messager.confirm('信息提示', tip, function (success) {
			if (!success) {
				return;
			}
            var url = contextPath + '/pub/upgrade/confirm';
			$('#datagrid').datagrid('loading');
			$.post(url, {'overrideMsgId':overrideMsgId}, function (result) {
				$('#datagrid').datagrid('loaded');
				if (result.code == 1) {
					top.showInfo('操作成功');
				} else {
					top.showInfo(result.msg);
				}
			});

		});

	},
});